package com.thkj.modules.sys.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.thkj.modules.sys.entity.TblTown;
import com.thkj.modules.sys.service.TblTownService;

import dp.dao.PagingList;
import dp.service.BaseService;

@Service
public class TblTownServiceImpl extends BaseService implements TblTownService {
	public void insertTblTown(TblTown t) {
		dao.insert("com.thkj.mapper.TblTown.insert", t);
	}

	public int updateTblTown(TblTown t) {
		int row = dao.update("com.thkj.mapper.TblTown.update", t);
		return row;
	}

	public int deleteTblTown(String t) {
		return dao.delete("com.thkj.mapper.TblTown.delete", t);
	}

	public TblTown getTblTownById(String t) {
		return dao.queryForObject("com.thkj.mapper.TblTown.getById", t, TblTown.class);
	}

	@Override
	public PagingList<Map> query(int pageIndex, int pageSize, Map<String, Object> param) {
		return dao.queryForPagingList("com.thkj.mapper.TblTown.query", param, pageIndex, pageSize, Map.class);
	}

	/**
	 * 区域（区镇DTO）
	 */
	public List<Map> queryRegion() {
		return dao.queryForList("com.thkj.mapper.TblTown.queryRegion", null, Map.class);
	}

}